package com.spzx.cart.api;

import com.spzx.cart.domain.CartInfo;
import com.spzx.common.core.constant.SecurityConstants;
import com.spzx.common.core.domain.R;
import com.spzx.common.core.web.domain.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

@FeignClient(value = "spzx-cart", fallbackFactory = RemoteCartFallbackFactory.class)
public interface RemoteCartService {
	@GetMapping("cartList")
	AjaxResult cartList(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);

	@GetMapping("getCartCheckedList/{userId}")
	R<List<CartInfo>> getCartCheckedList(@RequestHeader(SecurityConstants.FROM_SOURCE) String source, @PathVariable("userId") Long userId);


	// 删除购物车中选中的商品
	@GetMapping("deleteCartCheckList")
	void deleteCartCheckList(@RequestHeader(SecurityConstants.FROM_SOURCE) String source, Long userId);
}
